/*
	The Raja Toolkit.
	Copyright (C) 2011 Raja-Toolkit Foundation

	This library is free software; you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public
	License as published by the Free Software Foundation; either
	version 3.0 of the License, or (at your option) any later version.

	This library is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
	Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public
	License along with this library; if not, write to the Free Software
	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef SAMPLER2_HPP
#define SAMPLER2_HPP

#include "../types.hpp"
#include "../math/math.hpp"

namespace raja
{
namespace render
{

enum RESOURCE_USAGE
{
	RU_DEFAULT,
	RU_STATIC,
	RU_DYNAMIC,
};

enum SAMPLER_FORMAT
{
	SF_NOTYPE_A8,
	SF_NOTYPE_R8G8B8,
	SF_NOTYPE_R8G8B8A8,

	SF_UINT_A8,
	SF_UINT_R8G8B8,
	SF_UINT_R8G8B8A8,

	SF_FLOAT_A32,
	SF_FLOAT_R32G32B32,
	SF_FLOAT_R32G32B32A32,
};

struct sampler2
{
	/// create a sampler2
	/// @param width sampler2 width
	/// @param height sampler2 height
	/// @param st sampler format
	/// @param ru resource usage
	/// @param data pointer to the data to updload
	static sampler2*	create(uint32 width, uint32 height, SAMPLER_FORMAT st, RESOURCE_USAGE ru, const void *data);

	virtual ~sampler2();

	uint32				get_width() const { return __width; }
	uint32				get_height() const { return __height; }
	uint32				get_tex_id() const { return __tex_id; }

private:
	/// default constructor
	sampler2() : __width(0), __height(0), __tex_id(0)
	{
	}

	uint32			__width;		///< sampler width
	uint32			__height;		///< sampler height
	uint32			__tex_id;		///< sampler id (for internal use only)
};

typedef sampler2*	sampler2_ptr;

} // namespace render
} // namespace raja

#endif // SAMPLER2_HPP
